package com.example.ec.controller;

import com.example.ec.service.ProductService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class indexController extends BaseController {

    private ProductService productService;

    public indexController(ProductService productService) {
        this.productService = productService;
    }

    @GetMapping("/")
    private String index() {
        session.setAttribute("indexProducts", productService.queryAll());
        return "redirect:/product/index.jsp";
    }
}